package org.gnu.williamjoy.marycircles.model;

/**
 * Moving Circle
 */
public class MovingCircle extends Circle {

	/**
	 * Flag if the circle can be escaped
	 */
	private boolean escape;

	/**
	 * x-axis speed
	 */
	public float dx;

	/**
	 * x-axis speed
	 */
	public float dy;

	private int collision;
	
	public boolean isEscape() {
		return escape;
	}

	public void setEscape(boolean escape) {
		this.escape = escape;
	}

	public MovingCircle(float x, float y, int radius, int color) {
		super(x, y, radius, color);
		this.escape = false;
		this.collision = 0;
	}

	public float getDx() {
		return dx;
	}

	public void setDx(float dx) {
		this.dx = dx;
	}

	public float getDy() {
		return dy;
	}

	public void setDy(float dy) {
		this.dy = dy;
	}

	public float getXMomentum() {
		return mass * dx;
	}

	public float getYMomentum() {
		return mass * dy;
	}

	public int getCollision() {
		return collision;
	}

	public void hit() {
		this.collision++;
	}

	@Override
	public String toString() {
		return "MovingCircle [dx=" + dx + ", dy=" + dy + ", radius=" + radius
				+ ", color=" + color + ", x=" + x + ", y=" + y + "]";
	}

}
